
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles

import uvicorn
from controller.user import router as router_user 
from controller.user_tag import router as router_user_tag 
from controller.news import router as router_news
from controller.others import router as router_others
from controller.log import router as router_log
from controller.sport import router as router_sport
from fastapi.middleware.cors import CORSMiddleware
origins = [
    "*"]

app = FastAPI()

app.add_middleware(
    CORSMiddleware,
    allow_origins=origins,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)
app.include_router(router_user)
app.include_router(router_user_tag)
app.include_router(router_news)
app.include_router(router_others)
app.include_router(router_log)
app.include_router(router_sport)
app.mount("/static",StaticFiles(directory="upload",html=True),name="static")



if __name__ == "__main__":
    uvicorn.run("app:app",reload=True)


